package org.chaiyi.template.contract.demo;


import org.chaiyi.template.contract.supporter.CounterSetting;
import org.chaiyi.template.core.common.contract.CRUDContractor;
import org.chaiyi.template.core.common.contract.method.*;
import org.chaiyi.template.core.common.exception.BusinessError;
import org.chaiyi.template.core.common.repository.MongoEntity;
import org.chaiyi.template.core.common.supporter.MongoSupporter;


public interface IDemoService extends CRUDContractor<Demo> {

    interface Contract {
        String path = "demo/demo1";
        String name = "实例实体";
        Class<? extends MongoSupporter> supporter = CounterSetting.class;
        Class<? extends MongoEntity> entity = Demo.class;
    }

    interface Constant {

    }

    interface Caches {
        String FIND_BY_ID = "demo:findById:";
    }

    interface Error {
        BusinessError ERROR_DEMO = error("demo-001","这是业务异常( •̀ ω •́ )y");
        static BusinessError error(String code, String message) {
            return new BusinessError(code, message);
        }
    }
}
